<?php use_helper('I18N') ?>

<script type="text/javascript">
    $(function() {
        $(".editLink").button({
                    icons: {
                        primary: "ui-icon-circle-check"
                    }
                })
        $("#btnCreate").button({
                    icons: {
                        primary: "ui-icon-circle-plus"
                    }
                })
    });
</script>

<div style="padding: 10px; top: 10px; width: 98%">
    <div class="portlet" id="sf_admin_container">
        <div class="portlet-header">Categories</div>
        <div class="portlet-content" id="sf_admin_content" style="width: 98%">
            <table class="sf_admin_list" width="100%">
                <thead>
                <tr>
                    <th>Faq</th>
                    <th>Title</th>
                    <th>Answer</th>
                    <th>Status</th>
                </tr>
                </thead>
                <tbody>
                <?php
                $className = "sf_admin_row_1";
                foreach ($cms_faqs as $cms_faq):
                    if ($className == "sf_admin_row_0") {
                        $className = "sf_admin_row_1";
                    } else {
                        $className = "sf_admin_row_0";
                    }
                    ?>
                <tr class="<?php echo $className?>">
                    <td><?php echo link_to("EDIT", 'settings/faqEdit?faq_id=' . $cms_faq->getFaqId(), array('class' => 'editLink')) ?></td>
                    <td><?php echo $cms_faq->getFaqTitle() ?></td>
                    <td><?php echo $cms_faq->getFaqAnswer() ?></td>
                    <td><?php echo $cms_faq->getStatusCode() ?></td>
                </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
            <br>

            <div style="text-align: right">
                <?php echo link_to('create', 'settings/faqCreate', array("id" => "btnCreate")) ?>
            </div>
        </div>
    </div>
</div>
